package com.lin.controller;

import com.lin.base.Result;
import com.lin.service.AnalysisService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/analysis")
public class AnalysisController {
    @Resource
    private AnalysisService analysisService;

    @GetMapping("/heatmap")
    public Result getHeatMap(@RequestParam Double q, @RequestParam Double y) {
        List<double[]> heatMap = analysisService.getHeatMap(q, y);
        return Result.ok(heatMap);
    }

    @GetMapping("/heatmap3d")
    public Result getHeatMap3d(@RequestParam Double y) {
        List<double[]> heatMap3D = analysisService.getHeatMap3D(y);
        return Result.ok(heatMap3D);
    }
}
